package com.dianping.cat.home.dal.report;

import org.unidal.dal.jdbc.DataField;
import org.unidal.dal.jdbc.QueryDef;
import org.unidal.dal.jdbc.QueryType;
import org.unidal.dal.jdbc.Readset;
import org.unidal.dal.jdbc.Updateset;
import org.unidal.dal.jdbc.annotation.Attribute;
import org.unidal.dal.jdbc.annotation.Entity;
import org.unidal.dal.jdbc.annotation.Variable;

@Entity(logicalName = "metric-graph", physicalName = "metric_graph", alias = "mg")
public class MetricGraphEntity
{
  @Attribute(field = "id", nullable = false, primaryKey = true, autoIncrement = true)
/* 16 */   public static final DataField ID = new DataField("id");

  @Attribute(field = "graph_id")
/* 19 */   public static final DataField GRAPH_ID = new DataField("graph-id");

  @Attribute(field = "content")
/* 22 */   public static final DataField CONTENT = new DataField("content");

  @Attribute(field = "creation_date", nullable = false, insertExpr = "NOW()")
/* 25 */   public static final DataField CREATION_DATE = new DataField("creation-date");

  @Attribute(field = "updatetime", nullable = false, insertExpr = "NOW()", updateExpr = "NOW()")
/* 28 */   public static final DataField UPDATETIME = new DataField("updatetime");

  @Variable
/* 31 */   public static final DataField KEY_ID = new DataField("key-id");

  @Variable
/* 34 */   public static final DataField NUMBER = new DataField("number");

/* 36 */   public static final Readset<MetricGraph> READSET_FULL = new Readset(new DataField[] { ID, GRAPH_ID, CONTENT, CREATION_DATE, UPDATETIME });

/* 38 */   public static final Updateset<MetricGraph> UPDATESET_FULL = new Updateset(new DataField[] { ID, GRAPH_ID, CONTENT, UPDATETIME });

/* 40 */   public static final QueryDef FIND_BY_PK = new QueryDef("findByPK", MetricGraphEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 43 */   public static final QueryDef INSERT = new QueryDef("insert", MetricGraphEntity.class, QueryType.INSERT, "INSERT INTO <TABLE/>(<FIELDS/>) VALUES(<VALUES/>)");


/* 46 */   public static final QueryDef UPDATE_BY_PK = new QueryDef("updateByPK", MetricGraphEntity.class, QueryType.UPDATE, "UPDATE <TABLE/> SET <FIELDS/> WHERE <FIELD name='id'/> = ${key-id}");


/* 49 */   public static final QueryDef DELETE_BY_PK = new QueryDef("deleteByPK", MetricGraphEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='id'/> = ${key-id}");


/* 52 */   public static final QueryDef FIND_BY_GRAP_ID = new QueryDef("findByGrapId", MetricGraphEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> WHERE <FIELD name='graph-id'/> = ${graph-id}");


/* 55 */   public static final QueryDef FIND_LAST = new QueryDef("findLast", MetricGraphEntity.class, QueryType.SELECT, "SELECT <FIELDS/> FROM <TABLE/> ORDER BY <FIELD name='creation-date'/> DESC LIMIT ${number}");


/* 58 */   public static final QueryDef DELETE_BEFORE_DATE = new QueryDef("deleteBeforeDate", MetricGraphEntity.class, QueryType.DELETE, "DELETE FROM <TABLE/> WHERE <FIELD name='creation-date'/> < ${creation-date}");
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/dal/report/MetricGraphEntity.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */